home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
p4
/
p4-1_2c.lha
/
p4-1.2c
/
servers
/
killiserv_p4.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-24
|
870b
|
58 lines
#include "p4.h"
#include "p4_sys.h"
int debug_level;
char whoami[100];
char local_domain[100];
main(argc,argv)
int argc;
char **argv;
{
char host[100];
int i;
*local_domain = 0;
debug_level = 0;
sprintf(whoami, "kill_server_%d", getpid());
if (argc == 1)
{
get_qualified_hostname(host);
kill_server(host);
}
else
{
for (i = 1; i < argc; i++)
{
kill_server(argv[i]);
}
}
}
VOID kill_server(host)
char *host;
{
struct net_message_t msg;
int fd;
fd = net_conn_to_listener(host, UNRESERVED_PORT);
if (fd == -1)
{
printf("couldn't connect to server on %s\n", host);
return;
}
printf("killing server on %s\n", host);
msg.type = p4_i_to_n(NET_DONE);
net_send(fd, &msg, sizeof(msg), FALSE);
close(fd);
}
int slave() /* dummy proc */
{
return(0);
}